﻿using Amarok.Agents;
using Amarok.Presentation;


namespace Amarok.Samples
{
	/// <summary>
	/// </summary>
	public sealed class SampleDialogController : MyWindowControllerBase<UiSampleDialog>
	{
		#region ++ Public Interface ++

		/// <summary>
		/// </summary>
		public SampleDialogController(MyEnvironment environment, AgentOptions options, IView view, UiSampleDialog viewModel)
			: base(environment, options, view, viewModel)
		{
		}

		#endregion

		#region Implementation (Initialization)

		protected override void OnPresetViewModel(UiSampleDialog viewModel)
		{
			base.OnPresetViewModel(viewModel);

			viewModel.CloseCommand = new ViewCommand(_HandleCloseCommand);
		}

		private void _HandleCloseCommand()
		{
			var result = base.ShowConfirmationMessageBox(
				"Close dialog?",
				"Question");

			if (result)
				base.CloseWindow(true);
		}

		#endregion

	}
}
